<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../../../attr.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="${ctx}/css/sapar.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/common.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/kkpager_blue.css" />
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/js/sapar.js"></script>
<script type="text/javascript" src="${ctx}/js/WdatePicker.js"></script>
<script type="text/javascript" src="${ctx}/assets/layer/layer.js"></script>
<script type="text/javascript" src="${ctx}/js/kkpager.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/laydate/laydate.js"></script>
<script type="text/javascript" src="${ctx}/js/mask.js"></script>
<title>测试审核</title>
<style type="text/css">
th{
text-align: center;
}
td{
text-align: center;
}
</style>
</head>

<body>
<div id="mask" class="mask"></div>
<div id="left">
	<div id="saper-container">
        <div id="saper-hd"></div>
        <div id="saper-bd">
            <div class="subfiled clearfix">
                <h2>测试审核</h2>
            </div>
            <div class="subfiled-content">
                <!--表格开始-->
                <a href="javascript:;" class="sapar-btn sapar-btn-recom" id="baocun" >保存</a>
                <form action="" id="ceshiShenhe">
                <div id="table_left" class="table">
                    <!--表格操作-->
                    <!--表格具体内容-->
                    <div class="table-box">
                        <table>
                            <thead>
                                <tr>
                                    <th>测试流水</th>
                                    <th>测试机器</th>
                                    <th>测试软件</th>
                                    <th>测试人名称</th>
                                    <th>测试开始时间</th>
                                    <th>审核</th>
                                </tr>
                            </thead>
                            <tbody>
                                <c:if test="${lstCeshi != null}">
									<!-- var 是给给他起名字 -->
									<c:forEach items="${lstCeshi}" var="ceshi">
										<tr data="${ceshi.ceshiLiushui}" class="miejunData">
											<td>${ceshi.ceshiLiushui }<input type="hidden" name="ceshiLiushui" value="${ceshi.ceshiLiushui }"></td>
											<td>${ceshi.equip.equipName}</td>
											<td>${ceshi.ceshiSoft}</td>
											<td>${ceshi.employee.employeeName}</td>
											<td><fmt:formatDate value="${ceshi.ceshiKaishiTime}"
													type="date" pattern="yyyy-MM-dd HH:mm:ss" /></td>
											 <td>
											 <select name="ceshiHege">
											 	<option value="1">通过</option>
											 	<option value="2">不通过</option>
											 </select>
											 </td>
												
										</tr>
									</c:forEach>
								</c:if>
                                 
                            </tbody>
                        </table>
                    </div>
                </div><!--表格结束-->
                </form>
	                    </div>
                    </div>
				</div>
			</div>
        <div id="saper-ft">
        	<div id="kkpager"></div>
        </div>
        


    
   
<script type="text/javascript">
	$(function(){
		var totalPage = ${total};
    	var pageNo = getParameter('pageIndex');
    	if(!pageNo){
    		pageNo = 1;
    	}
    	kkpager.generPageHtml({
    		pno : pageNo,
    		//总页码
    		total : totalPage,
    		//链接前部
    		hrefFormer : '${ctx}/miejun/findShenhe',
    		//链接尾部
    		hrefLatter : '.do',
    		getLink : function(n){
    			return this.hrefFormer + this.hrefLatter + "?pageIndex="+n+"&searchTxt="+$(".search_text").val();
    		}
    	});
		
		$("#baocun").click(function(){
			showMask();
			$.ajax({
				type:"post",
				url:"${ctx}/miejun/clickShenhe.do",
				error:function(){
					layer.alert("网络故障，稍后再试");
				},
				data:$("#ceshiShenhe").serialize(),
				success:function(data){
					$("#mask").hide();
					if(data.state=="true"){
						 layer.alert("保存成功",function(){
							 window.location.href="${ctx}/miejun/findShenhe.do";
						 });
	 	           	}else{
	 	           		 layer.alert(data.msg);
	 	           	}
				}
			});
		});		
	});
	
  	function getParameter(name) { 
		var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 
		var r = window.location.search.substr(1).match(reg); 
		if (r!=null) return unescape(r[2]); return null;
	}
</script>

  
</body>
</html>